<template>
  <div class="container">
    <div class="fs-virtuallist-container">
      <div class="fs-virtuallist-list">
        <div class="fs-virtuallist-item">1</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'home',
  data () {
    return {
    }
  }
}
</script>

<style scoped lang="scss">
/* 容器布局并设置具体的宽高 */
.container {
  width: 600px;
  height: 600px;
  margin: 100px auto;
  border: 1px solid red;
}

/* 作为虚拟列表组件宽高由父组件决定，注意这里需要保证垂直方向有滚动条 */
.fs-virtuallist-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* list 高度会用 JS 设置动态样式 */
.fs-virtuallist-list {
  width: 100%;
}

/* item 固定高度即可，其他样式仅为了做展示 */
.fs-virtuallist-item {
  width: 100%;
  height: 100px;
  box-sizing: border-box;
  border: 1px solid #000;
  text-align: center;
  font-size: 20px;
  line-height: 100px;
}
</style>
